package com.zds.scm.service.impl;

import java.io.Serializable;
import java.util.List;

import com.zds.scm.dao.ClassInfoDAO;
import com.zds.scm.dao.impl.ClassInfoDAOImpl;
import com.zds.scm.domain.ClassInfo;
import com.zds.scm.service.ClassInfoService;

public class ClassInfoServiceImpl implements ClassInfoService {

	private ClassInfoDAO classInfoDAO=new ClassInfoDAOImpl();
	@Override
	public boolean delete(Serializable id) {
		ClassInfo classInfo=new ClassInfo();
		classInfo.setClassCode(id.toString());
		return classInfoDAO.delete(classInfo);
	}

	@Override
	public List<ClassInfo> findAll() {
		return classInfoDAO.findAll();
	}

	@Override
	public ClassInfo findById(Serializable id) {
		return classInfoDAO.findById(id);
	}

	@Override
	public boolean insert(ClassInfo t) {
		return classInfoDAO.insert(t);
	}

	@Override
	public boolean update(ClassInfo t) {
		return classInfoDAO.update(t);
	}

	@Override
	public List<ClassInfo> findAll(int currentPage, int pageSize) {
		return classInfoDAO.findAll(currentPage, pageSize);
	}

	@Override
	public List<ClassInfo> findByCode(String likeClassCode, int currentPage,int pageSize) {
		return classInfoDAO.findByCode(likeClassCode, currentPage, pageSize);
	}

	@Override
	public List<ClassInfo> findByDeptCode(String DeptCode, int currentPage,	int pageSize) {
		return classInfoDAO.findByDeptCode(DeptCode, currentPage, pageSize);
	}

	@Override
	public List<ClassInfo> findByName(String likeClassName, int currentPage,int pageSize) {
		return classInfoDAO.findByName(likeClassName, currentPage, pageSize);
	}

	@Override
	public int getTotalRows() {
		return classInfoDAO.getTotalRows();
	}

	@Override
	public int getTotalRowsByCode(String likeClassCode) {
		return classInfoDAO.getTotalRowsByCode(likeClassCode);
	}

	@Override
	public int getTotalRowsByName(String likeClassName) {
		return classInfoDAO.getTotalRowsByName(likeClassName);
	}

	@Override
	public int getTotalRowsDeptCode(String DeptCode) {
		return classInfoDAO.getTotalRowsDeptCode(DeptCode);
	}

	@Override
	public List<ClassInfo> findByNameAndCode(String likeClassCode,
			String likeClassName, String likeDeptCode, int currentPage,
			int pageSize) {
		return classInfoDAO.findByNameAndCode(likeClassCode, likeClassName, likeDeptCode, currentPage, pageSize);
	}

	@Override
	public int getTotalRowsByNameAndCode(String likeClassCode,
			String likeClassName, String likeDeptCode) {
		return classInfoDAO.getTotalRowsByNameAndCode(likeClassCode, likeClassName, likeDeptCode);
	}

}
